using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.Contracts;


namespace FoundationLib.Ifc.Rules 
{
	/// <summary>
	/// Provides functionality for validating entities
	/// </summary>
	public interface IRuleValidator  
	{
		/// <summary>
		/// Returns a set of all broken rules for the given entity
		/// </summary>
		/// <returns>A set of broken rules</returns>
		/// <param name="entity">The entity to validate</param>
		IEnumerable<IRule> BrokenRules(object entity);

		/// <summary>
		/// Checks whether the given entity is valid
		/// </summary>
		/// <param name="entity">The entity to validate</param>
		bool IsValid(object entity);

		/// <summary>
		/// Checks whether validation rules are available for the given entity
		/// </summary>
		/// <returns>True if there are validation rules, false if not</returns>
		/// <param name="entity">The entity to validate</param>
		bool IsValidatable(object entity);
	}

}